package admin

import (
	"context"

	"micro-oauth/datamodels/autherror"
	model "micro-oauth/datamodels"
	"micro-oauth/datamodels/params"
)

// AdminService提供 合阔官方用来管理其他partner数据 的功能, AdminService都只能抛出hexError
type AdminServiceInterface interface {
	// partner related
	GetPartnerById(ctx context.Context, partnerId uint64) (*model.Partner, autherror.HexError)
	AddPartner(ctx context.Context, req *params.PartnerAddRequest) (*model.Partner, autherror.HexError)
	UpdatePartner(ctx context.Context, req *params.PartnerUpdateRequest) (*model.Partner, autherror.HexError)
	ListPartner(ctx context.Context, req *params.PartnerListRequest) (partners []*model.Partner, total uint64, hexError autherror.HexError)
	DeletePartner(ctx context.Context, partnerId uint64) autherror.HexError

	// permission related
	AddPermission(ctx context.Context, req *params.PermissionCreateRequest) (*model.Permission, autherror.HexError)
	GetPermissionDetail(ctx context.Context, permissionId uint64) (*model.Permission, autherror.HexError)
	ListPermission(ctx context.Context, req *params.PermissionListRequest) (permis []*model.Permission, total uint64, hexerr autherror.HexError)
	UpdatePermission(ctx context.Context, req *params.PermissionUpdateRequest) (*model.Permission, autherror.HexError)
	AddPermissionAPIs(ctx context.Context, req *params.PermissionAddAPIsRequest) autherror.HexError
	DeletePermission(ctx context.Context, permissionId uint64) autherror.HexError
	ListPermissionMethod(ctx context.Context)([]*model.Method,autherror.HexError)

	// client related
	AddClient(ctx context.Context, req *params.ClientCreateRequest) (*model.Client, autherror.HexError)
	GetClientByPrimaryId(ctx context.Context, clientId uint64) (*model.Client, autherror.HexError)
	ListClient(ctx context.Context, req *params.ClientListRequest) (client []*model.Client, total uint64, hexerr autherror.HexError)
	UpdateClient(ctx context.Context, req *params.ClientUpdateRequest) (client *model.Client, hexerr autherror.HexError)
	DeleteClient(ctx context.Context, clientId uint64) autherror.HexError

	// api related
	AddAPI(ctx context.Context, req *params.APICreateRequest) (*model.API, autherror.HexError)
	GetAPI(ctx context.Context, permissionId uint64) (*model.API, autherror.HexError)
	ListAPIs(ctx context.Context, req *params.APIListRequest) (apis []*model.API, total uint64, hexerr autherror.HexError)
	UpdateAPI(ctx context.Context, req *params.APIUpdateRequest) (*model.API, autherror.HexError)
	DeleteAPI(ctx context.Context, apiId uint64) autherror.HexError

	// scope related
	AddScope(ctx context.Context, req *params.ScopeCreateRequest) (*model.Scope, autherror.HexError)
	UpdateScope(ctx context.Context, req *params.ScopeUpdateRequest) (*model.Scope, autherror.HexError)
	ListScope(ctx context.Context, req *params.ScopeListRequest) (scopes []*model.Scope, total uint64, hexerr autherror.HexError)
	GetScope(ctx context.Context, scopeId uint64) (*model.Scope, autherror.HexError)
	DeleteScope(ctx context.Context, scopeId uint64) autherror.HexError
}
